// eslint-disable-next-line
import { UserLayout } from '@/layouts'

export const asyncRouterMap = [
  {
    path: '/',
    name: 'index',
    component: () => import('@/layouts/BasicLayout'),
    meta: { title: '首页' },
    redirect: '/user-list',
    children: [
      {
        path: 'user-list',
        name: 'user-list',
        component: () => import('@/views/system/user/list'),
        meta: { title: '用户列表' },
        icon: 'idcard'
      },
      {
        path: 'group',
        name: 'group',
        component: () => import('@/views/system/group/list'),
        meta: { title: '分组管理' },
        icon: 'cluster'
      },
      {
        path: 'role',
        name: 'role',
        component: () => import('@/views/system/role/list'),
        meta: { title: '角色管理' },
        icon: 'team'
      },
      {
        path: 'organization',
        name: 'organization',
        component: () => import('@/views/system/organization/list'),
        meta: { title: '组织管理' },
        icon: 'deployment-unit'
      },
      {
        path: 'menu',
        name: 'menu',
        component: () => import('@/views/system/menu/list'),
        meta: { title: '资源管理' },
        icon: 'appstore'
      },
      {
        path: 'card',
        name: 'card',
        component: () => import('@/views/card/list'),
        meta: { title: '卡片列表' },
        icon: 'idcard'
      },
      {
        path: 'search',
        name: 'search',
        component: () => import('@/views/card/search'),
        meta: { title: '搜索卡片' },
        icon: 'idcard'
      },
      {
        path: 'components',
        component: () => import('@/layouts/BlankLayout'),
        redirect: '/components/tinymce',
        name: 'components',
        meta: { title: '自定义组件' },
        icon: 'experiment',
        children: [
          {
            path: 'tinymce',
            name: 'tinymce',
            component: () => import('@/views/example/tinymce'),
            meta: { title: 'Tinymce编辑器' },
            icon: 'code'
          }
        ]
      },
      {
        path: 'exception',
        component: () => import('@/layouts/BlankLayout'),
        redirect: '/exception/403',
        name: 'exception',
        meta: { title: '错误页面' },
        icon: 'experiment',
        children: [
          {
            path: '403',
            name: '403',
            component: () => import('@/views/exception/403'),
            meta: { title: '403', hiddenHeaderContent: true },
            icon: 'exclamation-circle'
          },
          {
            path: '404',
            name: 'exception404',
            component: () => import('@/views/exception/404'),
            meta: { title: '404', hiddenHeaderContent: true },
            icon: 'close-circle'
          },
          {
            path: '500',
            name: '500',
            component: () => import('@/views/exception/500'),
            meta: { title: '500', hiddenHeaderContent: true },
            icon: 'close-square'
          }
        ]
      },
      {
        path: 'https://www.baidu.com/',
        name: 'baidu',
        meta: {
          title: '外部链接',
          isOutside: 1,
          target: '_blank'
        },
        icon: 'ie'
      },
      {
        path: 'myiframe',
        name: 'myiframe',
        meta: {
          title: '内嵌 iframe',
          isOutside: 1,
          component: 'https://www.baidu.com/'
        },
        icon: 'profile'
      }
    ]
  }
]

/**
 * 基础路由
 * @type { *[] }
 */
export const constantRouterMap = [
  {
    path: '/403',
    name: 'exception-403',
    meta: { title: '403' },
    component: () => import(/* webpackChunkName: "fail" */ '@/views/exception/403')
  },
  {
    path: '/500',
    name: 'exception-500',
    meta: { title: '500' },
    component: () => import(/* webpackChunkName: "fail" */ '@/views/exception/500')
  },
  {
    path: '/404',
    name: 'exception-404',
    meta: { title: '404' },
    component: () => import(/* webpackChunkName: "fail" */ '@/views/exception/404')
  }
]
